import request from '@/utils/request'

export function getRoles(params) {
  return request({
    url: '/sys/role',
    method: 'GET',
    params
  })
}

export function getCompanyInfo(id) {
  return request({
    url: `/company/${id}`,
    method: 'GET'
  })
}

// 新增角色
export function addRoleFn(data) {
  return request({
    url: '/sys/role',
    method: 'POST',
    data
  })
}

// 获取角色id
export function getRoleId(id) {
  return request({
    url: `/sys/role/${id}`,
    method: 'GET'
  })
}

// 编辑角色id
export function updateRole(data) {
  return request({
    url: `/sys/role/${data.id}`,
    method: 'PUT',
    data
  })
}

// 根据id删除角色

export function delRole(id) {
  return request({
    url: `/sys/role/${id}`,
    method: 'DELETE'
  })
}
